﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.IO;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Data;
using System.Data.Objects;
using System.Data.SqlServerCe;
using System.Xml;
using System.Xml.Linq;
using WinBudget.Properties;

namespace WinBudget
{
    /// <summary>
    /// Interaction logic for Headers.xaml
    /// </summary>
    public partial class Headers : Window
    {       
        public Headers()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (Settings.Default.HeaderType == "Calendar")
            {
                TextBlock tb1 = new TextBlock();
                tb1.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                //tb1.Margin.Bottom = 6;
            }
        }

        
        private void button1_Click(object sender, RoutedEventArgs e)
        {            
            XmlTextWriter tw = new XmlTextWriter("Accounts.xml", null);
            tw.WriteStartDocument();
            tw.WriteStartElement("Accounts");
            tw.WriteStartElement("Account");
            tw.WriteElementString("Account_Name", accountNameTextBox.Text);
            tw.WriteElementString("Income", incomeTextBox.Text);
            tw.WriteEndElement();
            tw.WriteStartElement("Account");
            tw.WriteElementString("Account_Name", "Grace");
            tw.WriteElementString("Income", "2222");
            tw.WriteEndElement();
            tw.Flush();
            tw.Close();            
        }

        private void button4_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }            
    }
}
